package com.easefun.polyv.livecommon.ui.util;

import java.text.DecimalFormat;

public class StringUtils {
    public static String dou1String(double dou) {
        DecimalFormat decimalFormat = new DecimalFormat("#0.0");
        return decimalFormat.format(dou);
    }

    public static String toWString(long count){
        if (count < 999) {
            return count + "";
        } else if (count >= 1000 && count < 10000) {
           return  dou1String(count / 1000.0) + "k";
        } else if (count >= 10000 && count < 100000000) {
            return  dou1String(count / 10000.0) + "w";
        } else {
            return  dou1String(count / 100000000.0) + "亿";
        }
    }
}
